package com.minimalist.common.entity.lindi.vo.activity;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.config.swagger.SchemaEnum;
import com.minimalist.common.entity.basic.enums.StatusEnum;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * @author 11987
 */

@Schema(name = "林地指标平台_活动实体")
public class LindiActivityVO implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @NotNull(message = "活动ID不能为空", groups = {Update.class})
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "activityId", description = "活动ID", type = "string")
    private Long activityId;

    @NotBlank(message = "活动标题不能为空", groups = {Add.class, Update.class})
    @Schema(name = "activityTitle", description = "活动标题", type = "string")
    private String activityTitle;

    @Schema(name = "activityContent", description = "活动内容", type = "string")
    private String activityContent;

    @NotNull(message = "活动状态不能为空", groups = {Add.class, Update.class})
    @SchemaEnum(implementation = StatusEnum.class)
    @Schema(name = "status", description = "活动状态", type = "string")
    private Integer status;

    @NotNull(message = "活动置顶不能为空", groups = {Add.class, Update.class})
    @Schema(name = "activityTop", description = "活动置顶", type = "string")
    private Boolean activityTop;

    @Schema(name = "activitySort", description = "活动排序", type = "string")
    private Integer activitySort;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "createId", description = "创建人ID", type = "string")
    private Long createId;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "updateId", description = "更新人ID", type = "string")
    private Long updateId;

    @Schema(name = "createTime", description = "创建时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime createTime;

    @Schema(name = "updateTime", description = "更新时间", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime updateTime;

    public LindiActivityVO(){
    }

    public Long getActivityId(){
        return activityId;
    }

    public void setActivityId(Long activityId){
        this.activityId = activityId;
    }

    public String getActivityTitle(){
        return activityTitle;
    }

    public void setActivityTitle(String activityTitle){
        this.activityTitle = activityTitle;
    }

    public String getActivityContent(){
        return activityContent;
    }

    public void setActivityContent(String activityContent){
        this.activityContent = activityContent;
    }

    public Integer getStatus(){
        return status;
    }

    public void setStatus(Integer status){
        this.status = status;
    }

    public Boolean getActivityTop(){
        return activityTop;
    }

    public void setActivityTop(Boolean activityTop){
        this.activityTop = activityTop;
    }

    public Integer getActivitySort(){
        return activitySort;
    }

    public void setActivitySort(Integer activitySort){
        this.activitySort = activitySort;
    }

    public Long getCreateId(){
        return createId;
    }

    public void setCreateId(Long createId){
        this.createId = createId;
    }

    public Long getUpdateId(){
        return updateId;
    }

    public void setUpdateId(Long updateId){
        this.updateId = updateId;
    }

    public LocalDateTime getCreateTime(){
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime){
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime(){
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime){
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        LindiActivityVO that = (LindiActivityVO) o;
        return Objects.equals(activityId, that.activityId) && Objects.equals(activityTitle, that.activityTitle) && Objects.equals(activityContent, that.activityContent) && Objects.equals(status, that.status) && Objects.equals(activityTop, that.activityTop) && Objects.equals(activitySort, that.activitySort) && Objects.equals(createId, that.createId) && Objects.equals(updateId, that.updateId) && Objects.equals(createTime, that.createTime) && Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode(){
        return Objects.hash(activityId, activityTitle, activityContent, status, activityTop, activitySort, createId, updateId, createTime, updateTime);
    }
}
